import { axios } from '@/utils/request'
import { METHOD } from '@/store/mutation-types'

/**
 * 流程发起
 * @param {*} processCode 流程定义编码
 * @param {*} parameter 流程表单参数
 * @returns
 */
export function processStart(processCode, parameter) {
  return axios({
    url: `/camunda/process/start/${processCode}`,
    method: METHOD.POST,
    data: parameter
  })
}

/**
 * 获取流程实例
 * @param {*} processInstanceId 流程定义编码
 * @returns
 */
export function processInstance(processInstanceId, parameter) {
  return axios({
    url: `/camunda/process/list/${processInstanceId}`,
    method: METHOD.GET
  })
}
